; by Jeremy Friesner. Miami support by Fredrik Rambris.
(transcript "On installing AMarquee...")
(set InstallOpts
(askoptions
(
(prompt "Please indicate which parts of the AMarquee system you wish to install.")
(help "Which parts of the AMarquee system you should install depend on what you want to do with AMarquee on your system. Only install the AMarquee server if you wish to use your computer as a host for other Amigas to connect to with their AMarquee programs. Only install the AMarquee C include files if you wish to write your own AMarquee programs.")
(choices
"amarquee.library"
"AMarqueed server"
"AMarquee.library C include files"
"AMarquee Documentation"
"AMarquee Example Programs"
)
)
)
)
(if (BITAND InstallOpts 1)
(
; install amarquee.library
(copylib
(source "amarquee.library")
(dest "LIBS:")
)
)
)
(if (BITAND InstallOpts 2)
(
; install AMarqueed server
(set tcpsys
(askchoice
(prompt "Which TCP software do you wish to run AMarqueed with?")
(help @askdir-help)
(choices
"AmiTCP"
"Miami"
"Other"
)
)
)
(if (= tcpsys 2)
(message "\nThis Installer script only knows how to install AMarqueed for AmiTCP or Miami. To install AMarqueed for another system, you will need to do it yourself. See the AMarquee installation documentation for what needs to be done for Miami or AmiTCP; your TCP stack will likely have similar requirements. This script can still install the other components of the AMarquee package, though.")
(
(if (= tcpsys 0)
(set servdir "AmiTCP:Serv")
(set servdir
(askdir
(prompt "Where do you want to put the AMarquee server executable, AMarqueed?")
(help @askdir-help)
(default "Work:")
)
)
)
(copyfiles
(source "AMarqueed")
(dest servdir)
)
(set makeResident
(askbool
(
(prompt "\n\nDo you wish to make AMarqueed resident in memory? This will save memory when multiple connections are active simultaneously.")
(help "Making a program resident causes AmigaDOS to keep its executable in memory permanently. When the program is run, instead of loading a new copy of the code into memory, the resident code is shared by the new process.")
(default 1)
)
)
)
(if (= makeResident 1)
(
(set InetDPath "AMarqueed")
(startup "AMarqueed"
(prompt ("\n\nOkay to put the line\n\nresident >NIL: %s pure\n\ninto your s:user-startup?" (tackon servdir "AMarqueed")))
(help "This line in your user-startup will load AMarqueed into memory so that it can be found when needed by inetd. If you choose not to add this line here, you will need to execute it somewhere else, or inetd will not be able to find AMarqueed and will refuse AMarqueed connections.")
(prompt "\n\nTo use AMarqueed with AmiTCP, the line:\n\nAMarquee 2957/tcp\n\nneeds to be present in your amitcp:db/services file. Do you wish me to update the file? (Note: AMarquee will not receive connections if this line is not precisely as shown above!)")
(help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations. Also it will make a backup (to amitcp:db/services.bak) before writing.")
(confirm)
)
(if (not (exists "t:edit_text_succeeded") )
(message "The config file editing script (EditTextFile.rexx) did not complete successfully. You may need to edit your amitcp:db/services file yourself. Look in the 'Installation' section of the AMarquee docs for instructions.")
(prompt (cat "\nAlso, the line:\n\nAMarquee stream tcp nowait root " InetDPath "\n\nneeds to be present in your amitcp:db/inetd.conf file. Do you wish me to update that file?\n(Note: AMarquee will not receive connections if this line is not precisely as shown above!)"))
(help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations. Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
(confirm)
)
(if (not (exists "t:edit_text_succeeded") )
(message "The config file editing script (EditTextFile.rexx) did not complete successfully. You may need to edit your amitcp:db/inetd.conf file yourself. Look in the 'Installation' section of the AMarquee docs for instructions.")
)
)
(
; Do config files for Miami: Create the textfile with a pointer to AMarqueed
; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
; may have their lines there too)
(run "type t:dbtemp >>envarc:MiamiChangeDB")
; If Miami shoule be running... why not make it read the new settings?
(run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
; Clean up
(delete "t:dbtemp")
)
)
; set ENV vars if desired
(set ServerOpts
(askoptions
(prompt "There are several ENV variables AMarqueed looks at to determine limits on usage of your system. Please check the usage limitations you wish to enforce.")
(help "Each of these options will set for you an ENV variable. This variable will be copied into ENVARC: so that it will be retained after rebooting. To change the setting later, simply edit the file in ENVARC:, or use setenv and then copy the file from env: to envarc: when you are happy with it.")
(choices "Limit memory used per session" "Specify minimum amount of memory to keep free" "Limit number of connections per host" "Limit total number of connections" "Ban certain hosts or programs" "Set AMarqueed's execution priority" "Adjust idle-ping rate")
(default 0)
)
)
(if (BITAND ServerOpts 1)
(
; AMARQUEED_MAXMEM
(set AMarqueed_MaxMem
(asknumber
(prompt "\n\nSpecify the maximum amount (in kilobytes) of memory that each AMarquee connection may allocate. (Enter -1 to impose no individual allocation limit)")
(help "By setting this value, you can guarantee that no one AMarqueed process will dynamically allocate more than a certain amount of your RAM.")
(range -1 99999999999)
(default -1)
)
)
;Else
(textfile
(dest "ENVARC:AMARQUEED_MAXMEM")
(append AMarqueed_MaxMem)
)
)
)
(if (BITAND ServerOpts 2)
(
; AMARQUEED_MINFREE
(set AMarqueed_MinFree
(asknumber
(prompt "\n\nSpecify (in kilobytes) the minimum amount of memory that should be left free on your system at all times. (Enter -1 to impose no minimum free store restriction)")
(help "By setting this value, you can guarantee that no AMarqueed process will grab the last kilobytes of memory left in your system. Of course, this ENV variable cannot affect what other programs do...")
(range -1 99999999999)
(default -1)
)
)
;Else
(textfile
(dest "ENVARC:AMARQUEED_MINFREE")
(append AMarqueed_MinFree)
)
)
)
(if (BITAND ServerOpts 4)
(
; AMARQUEED_MAXCONN
(set AMarqueed_MaxConn
(asknumber
(prompt "\n\nSpecify the maximum number of simultaneous connections that any one Amiga may have to your AMarquee server. (Enter -1 to impose no maximum number of connections)")
(help "This setting will prevent any one client machine from hogging your system by opening too many connections.")
(range -1 99999999999)
(default -1)
)
)
(textfile
(dest "ENVARC:AMARQUEED_MAXCONN")
(append AMarqueed_MaxConn)
)
)
)
(if (BITAND ServerOpts 8)
(
; AMARQUEED_TOTALMAXCONN
(set AMarqueed_TotalMaxConn
(asknumber
(prompt "\n\nSpecify the total maximum number of simultaneous AMarquee connections that can exist on your system at once. (Enter -1 to impose no maximum number of connections)")
(help "By setting this value, you can guarantee that no more than (n) Amarquee connections will ever be active at once. Using this in combination with the AMARQUEED_MAXMEM ENV variable puts a finite limit on the total amount of your RAM that could be in use by Amarqueed at any one time.")
(range -1 99999999999)
(default -1)
)
)
(textfile
(dest "ENVARC:AMARQUEED_TOTALMAXCONN")
(append AMarqueed_TotalMaxConn)
)
)
)
(if (BITAND ServerOpts 16)
(
; AMARQUEED_BANNED
(set AMarqueed_banned
(askstring
(prompt "\n\nSpecify a regular expression to determine which hosts and/or programs should be banned from your computer. (Enter "" to impose no restrictions) The regular expression should be in the form /HostExp/ProgExp. See the Help for examples.")
(help "Examples: To ban all hosts from Australia, use /#?.au/#?. Or to ban all amarquee clients named Bob, use /#?/Bob. Or perhaps you have a list of things to ban: /(evil.hackers.com|sdcc8.ucsd.edu|fred.nerd.org)/#?")
(default "")
)
)
(textfile
(dest "ENVARC:AMARQUEED_BANNED")
(append AMarqueed_BANNED)
)
)
)
(if (BITAND ServerOpts 32)
(
; AMARQUEED_PRIORITY
(set AMarqueed_Priority
(asknumber
(prompt "\n\nSpecify the priority that AMarqueed daemons should execute at.")
(help "This is the standard Amiga priority system--lower priority programs get less CPU time when the system is busy, higher priority programs get more.")
(range -128 127)
(default -10)
)
)
(textfile
(dest "ENVARC:AMARQUEED_PRIORITY")
(append AMarqueed_Priority)
)
)
)
(if (BITAND ServerOpts 64)
(
; AMARQUEED_PINGRATE
(set AMarqueed_PingRate
(asknumber
(prompt "\n\nSpecify the number of minutes of idle time that should elapse before an idle-ping query is issued.")
(help "In order to ensure that all connections are still 'live', AMarqueed occasionally sends out an 'are you still there?' request to any client that hasn't been heard from for a while. Shorter ping rates cause a (very) slight extra demand on network and CPU usage, but cut down on the likelihood of 'dead' connections taking up memory.")
(range 1 99999999999)
(default 3)
)
)
(textfile
(dest "ENVARC:AMARQUEED_MAXMEM")
(append AMarqueed_MaxMem)
)
)
)
(if (> ServerOpts 0)
(run "copy ENVARC:AMARQUEED_#? env:")
)
)
)
)
)
(if (BITAND InstallOpts 4)
(
; install AMarquee SDK
(set IncludeDir
(askdir
(prompt "Please indicate your Amiga include directory. This is the directory that contains the clib, libraries, fd, and pragmas subdirectories.")
(help "The Installer script is now going to install header files into your Amiga include directory. The files to be installed include clib/amarquee_protos.h, libraries/amarquee.h, pragmas/amarquee_pragmas.h, and fd/amarquee.fd")
(default "include:amiga")
)
)
(copyfiles
(source "include/amiga")
(dest IncludeDir)
(all)
)
)
)
(if (BITAND InstallOpts 8)
(
; install AMarquee docs
(set DocDir
(askdir
(prompt "Please indicate the directory to put the AMarquee.guide into:")
(help "No new directory will be created!")
(default "ram:")
(newpath)
)
)
(copyfiles
(source "AMarquee.guide")
(dest DocDir)
(infos)
)
)
)
(if (BITAND InstallOpts 16)
(
; install AMarquee example programs
(set ExampleDir
(askdir
(prompt "Please indicate the directory to create the ExamplePrograms directory in.") (help "A new directory named AMarqueeExamples will be created in the directory you specify.")